/*    */ package com.cr.web.controller.system;
/*    */ 
/*    */ import com.cr.common.core.controller.BaseController;
/*    */ import com.cr.common.core.domain.AjaxResult;
/*    */ import com.cr.common.core.domain.entity.SysUser;
/*    */ import com.cr.framework.shiro.service.SysRegisterService;
/*    */ import com.cr.system.service.ISysConfigService;
/*    */ import org.springframework.beans.factory.annotation.Autowired;
/*    */ import org.springframework.stereotype.Controller;
/*    */ import org.springframework.util.StringUtils;
/*    */ import org.springframework.web.bind.annotation.GetMapping;
/*    */ import org.springframework.web.bind.annotation.PostMapping;
/*    */ import org.springframework.web.bind.annotation.ResponseBody;
/*    */ 
/*    */ @Controller
/*    */ public class SysRegisterController extends BaseController {
/*    */   @Autowired
/*    */   private SysRegisterService registerService;
/*    */   
/*    */   @Autowired
/*    */   private ISysConfigService configService;
/*    */   
/*    */   @GetMapping({"/register"})
/*    */   public String register() {
/* 32 */     return "register";
/*    */   }
/*    */   
/*    */   @PostMapping({"/register"})
/*    */   @ResponseBody
/*    */   public AjaxResult ajaxRegister(SysUser user) {
/* 39 */     if (!"true".equals(this.configService.selectConfigByKey("sys.account.registerUser")))
/* 41 */       return error("当前系统没有开启注册功能！"); 
/* 43 */     String msg = this.registerService.register(user);
/* 44 */     return StringUtils.isEmpty(msg) ? success() : error(msg);
/*    */   }
/*    */ }


/* Location:              D:\tmp\creditorRights-admin\BOOT-INF\classes\com.zip!\com\cr\web\controller\system\SysRegisterController.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */